<?php
// +----------------------------------------------------------------------
// | 演出类产品下单前数据获取
// +----------------------------------------------------------------------
// | Author: TongBC <501468940@qq.com>
// +----------------------------------------------------------------------
// | Date  : 2015/06/23
// +----------------------------------------------------------------------
use \PFT\Db;
include_once '/var/www/html/new/com.inc.php';
include_once '/var/www/html/new/d/common/func.inc.php';
include_once '/var/www/html/new/d/module/common/Db.class.php';
include_once '/var/www/html/new/d/class/abc/Product_H.class.php';

$dbConf = include '/var/www/html/new/d/module/common/db.conf.php';// 远端服务器配置信息

Db::Conf($dbConf['remote_1']);

$ac=$GLOBALS['_ac'];
$pw=$GLOBALS['_pw'];
$s = new SoapClient(null,array("location" => "http://localhost/open/openService/pft_insideMX.php","uri" => "www.16u.com?ac_16u=$ac|pw_16u=$pw|auth_16u=true"));

if(!isset($_SESSION['sid']) && !defined('IN_PFT')) exit('{"status":"fail","msg":"登陆超时","code":0}');

$method = $_REQUEST['m'];

if($_REQUEST['m']=='round'){// 根据日期获取场次
	$date = $_REQUEST['date'];
	$venus_id = $_REQUEST['venus_id']+0;
	$p = new abc777\Product_H(Db::Connect());
	$rounds = $p->rounds($venus_id, $date, 1);
	// 过滤已过期的场次
	// print_r($rounds);
	$time = time(); $tmp = array();
	foreach($rounds as $key=>$row){
		if(strtotime($row['use_date'].' '.$row['et'])<$time) continue;
		$tmp[] = $row;
	}
	$rounds = $tmp;
	exit(json_encode(array('status'=>'success','rounds'=>$rounds)));
	
}else{
	exit(json_encode(array('status'=>'fail','msg'=>'非法访问')));
}
